const option= {
    color: ['rgb(78, 115, 223)', 'rgb(78, 115, 223)',],
    tooltip: { //提示框
        trigger: 'axis',
        formatter: function (params,) {
            return '<div ">' + params[0].name + '<br>' + 'Earnings' + ':' + '<span >' + '$' + params[0].value + '.000' + '</div>';
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        top: '17%',
        containLabel: true //grid区域是否包含坐标轴的刻度标签
    },
    xAxis: {
        type: 'category', //坐标轴类型。
        boundaryGap: false, //坐标轴两边留白策略
        data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',],
        axisLine: {//坐标轴轴线相关设置
            show: false,
            lineStyle: {
                color: 'rgb(133, 135, 150)',
                type: 'dashed'
            }
        },
        axisLabel: { //X轴刻度配置
            interval: 0, //0：表示全部显示不间隔；auto:表示自动根据刻度个数和宽度自动设置间隔个数
            formatter: (value, index) => {
                if (index % 2 !== 0) {
                    return ' '
                }
                else {
                    return value;
                }

            },
        }
    },
    yAxis: {
        type: 'value',
        axisLabel: {
            formatter: (param) => {
                return '$' + param + '.000';
            }
        },
        axisLine: {//坐标轴轴线相关设置
            show: false,
            lineStyle: {
                color: 'rgb(133, 135, 150)',
                type: 'dashed'
            }
        },
    },
    series: [
        {
            type: 'line',
            smooth: true,
            data: [0, 10, 5, 15, 10, 20, 15, 25, 20, 30, 25, 40],
            lineStyle: {
                color: 'rgb(78, 115, 223)',//线的颜色
                width: 3
            }
        },
    ]
}
const optiontwo= {
    title: {
        left: 'center',
        textStyle: {
            color: '#6d6'
        }
    },
    tooltip: {},
    legend: {
        bottom: 0,
        orient: 'horizontal',
        data: ['social', 'direct', 'referral',]
    },
    color: ['#00CED1', '#4169E1', '#3CB371'],
    dataset: {
        source: [
            ['social', 'direct', 'referral',],
            [15, 55, 35]
        ]
    },
    series: [
        {
            name: '',
            type: 'pie',
            seriesLayoutBy: 'row',
            encode: {
                itemName: 0,   //数据项名称，在legend中展示
                value: 1
            },
            label: {
                show: false,
                position: 'center'
            },

            radius: ['65%', '80%']    //设置不同的内外半径
        }
    ]
}
export {optiontwo,option}